package com.smzd.ccms.business;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.smzd.ccms.dao.CompletSpotDao;
import com.smzd.ccms.domain.CompletSpot;
import com.smzd.core.dao.IDao;
import com.smzd.framework.core.business.AbstractFGService;
import com.smzd.framework.utils.db.FGRowConverter;

@Service
public class CompletSpotService extends AbstractFGService<CompletSpot> {
    @Autowired
    private CompletSpotDao dao;
    
    @Override
    protected IDao<CompletSpot> getDao() {
        return dao;
    }
    
    @Override
    public FGRowConverter<CompletSpot> getConverter() {
        return converter;
    }

    private static FGRowConverter<CompletSpot> converter = new FGRowConverter<CompletSpot>() {
        @Override
        public Object[] convert(CompletSpot elem) {
            Object[] fs = new Object[]{
                    elem.getId(),
                    elem.getName(),
                    elem.getDescription(),
                    elem.getLength(),
                    elem.getWidth()
                };
                return fs;
        }
    };
    
}